import { db } from '../db/index'
import { Model, DataTypes } from 'sequelize'
class Role extends Model {
    public id!: number
    public role!: string
    public menu!: string
    public remake!: string
  }
  Role.init({
    id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        autoIncrement: true,
        primaryKey: true
    },
    role: {
        type: DataTypes.STRING,
        comment: '权限',
        allowNull: false
    },
    menu: {
        type: DataTypes.TEXT,
        comment: '菜单表',
        allowNull: false
    },
    remake: {
        type: DataTypes.STRING,
        comment: '备注',
        allowNull: false
    }
  }, {
    tableName: 'roles',
    modelName: 'role',
    sequelize: db
  });
// 创建表
// Role.sync({ force: true })

export default Role